package com.linsir.lin.controller.meta;

import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.dto.MetaFieldDTO;
import com.linsir.lin.pojo.MetaField;
import com.linsir.lin.service.MetaFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

/**
 * @author ：linsir
 * @date ：Created in 2021/7/23 10:29
 * @description：字段
 * @modified By：
 * @version: 1.0.0
 */
@RestController
@RequestMapping(value = "/metaField/")
public class MetaFieldController {

    @Autowired
    private MetaFieldService metaFieldService;

    @RequestMapping(value = "/grid", method = {RequestMethod.GET, RequestMethod.POST})
    public GridDTO<MetaFieldDTO> grid(String page,
                                      String limit,
                                      String searchParams) throws IOException, InvocationTargetException, IllegalAccessException {
        return metaFieldService.grid(page, limit, searchParams);
    }
}
